package com.union.utils;

import android.text.TextUtils;

public class SessionUtils {
    private SessionUtils() {
    }

    public static void putUserPhone(String userPhone) {
        PreferUtils.put("userPhone", userPhone);
    }

    public static String getUserPhone() {
        return PreferUtils.getString("userPhone", "");
    }

    public static void putScore(String score) {
        PreferUtils.put("score", score);
    }

    public static boolean getIsUsed() {
        return PreferUtils.getBoolean("isused", false);
    }

    public static void putisUsed(boolean isused) {
        PreferUtils.put("isused", isused);
    }

    public static void putLineId(String lineId) {
        PreferUtils.put("lineId", lineId);
    }

    public static String getLineId() {
        return PreferUtils.getString("lineId", "");
    }

    public static int getVersionCode() {
        return PreferUtils.getInt("versionCode", 102);
    }

    public static void putVersionCode(int versionCode) {
        PreferUtils.put("versionCode", versionCode);
    }

    public static String getScore() {
        return PreferUtils.getString("score", "");
    }

    public static void putIcId(String ic_id) {
        PreferUtils.put("ic_id", ic_id);
    }

    public static String getIcId() {
        return PreferUtils.getString("ic_id", "");
    }

    public static void clearScore() {
        PreferUtils.put("score", "");
    }

    public static void putUserId(String user_id) {
        PreferUtils.put("user_id", user_id);
    }

    public static String getUserId() {
        return PreferUtils.getString("user_id", "");
    }

    public static void putTotalDay(String totalday) {
        PreferUtils.put("totalday", totalday);
    }

    public static String getTotalDay() {
        return PreferUtils.getString("totalday", "");
    }

    public static void putStartStepCount(String startStepCount) {
        PreferUtils.put("startStepCount", startStepCount);
    }

    public static String getStartStepCount() {
        return PreferUtils.getString("startStepCount", "0");
    }

    public static void putHardware(String hardware) {
        PreferUtils.put("hardware", hardware);
    }

    public static String getHardware() {
        return PreferUtils.getString("hardware", "");
    }

    public static void clearUserId() {
        PreferUtils.put("user_id", "");
    }

    public static void putUserStep(String Step) {
        PreferUtils.put("userStep", Step);
    }

    public static String getUserStep() {
        return PreferUtils.getString("userStep", "0");
    }

    public static void putUserStepDate(String StepDate) {
        PreferUtils.put("userStepDate", StepDate);
    }

    public static String getUserStepDate() {
        return PreferUtils.getString("userStepDate", "0");
    }

    public static void clearUserCart() {
        PreferUtils.put("userCart", "");
    }

    public static void putPayPwd(String payPwd) {
        PreferUtils.put("payPwd", payPwd);
    }

    public static String getPayPwd() {
        return PreferUtils.getString("payPwd", "");
    }

    public static void clearPayPwd() {
        PreferUtils.put("payPwd", "");
    }

    public static void putIsWorker(String isWorker) {
        PreferUtils.put("isWorker", isWorker);
    }

    public static String getIsWorker() {
        return PreferUtils.getString("isWorker", "");
    }

    public static void clearIsWorker() {
        PreferUtils.put("isWorker", "");
    }

    public static void putRunStatus(boolean runStatus) {
        PreferUtils.put("runStatus", runStatus);
    }

    public static boolean getRunStatus() {
        return PreferUtils.getBoolean("runStatus", false);
    }

    public static void putDistance(float distance) {
        PreferUtils.put("distance", distance);
    }

    public static float getDistance() {
        return PreferUtils.getFloat("distance", 0);
    }

    public static void putTotalRunningStep(int totalstep) {
        PreferUtils.put("totalstep", totalstep);
    }

    public static int getTotalRunningStep() {
        return PreferUtils.getInt("totalstep", 0);
    }

    public static void putTotalRunningTime(long totaltime) {
        PreferUtils.put("totaltime", totaltime);
    }

    public static long getTotalRunningTime() {
        return PreferUtils.getLong("totaltime", 0);
    }

    public static void putSubmitTime(long submitTime) {
        PreferUtils.put("submitTime", submitTime);
    }

    public static long getSubmitTime() {
        return PreferUtils.getLong("submitTime", 0);
    }

    public static void putUserNiceName(String user_nicename) {
        PreferUtils.put("user_nicename", user_nicename);
    }

    public static String getUserNiceName() {
        return PreferUtils.getString("user_nicename", "");
    }

    public static void clearUserNiceName() {
        PreferUtils.put("user_nicename", "");
    }

    public static void putHeight(String height) {
        PreferUtils.put("height", height);
    }

    public static String getHeight() {
        return PreferUtils.getString("height", "165");
    }


    public static void putIsPin(String ispin) {
        PreferUtils.put("ispin", ispin);
    }

    public static String getIsPin() {
        return PreferUtils.getString("ispin", "");
    }


    public static void putPhotoAddr(String photoAddr) {
        PreferUtils.put("photoAddr", photoAddr);
    }

    public static String getPhotoAddr() {
        return PreferUtils.getString("photoAddr", "");
    }

    public static void clearPhotoAddr() {
        PreferUtils.put("photoAddr", "");
    }

    public static void putGetAddr(String address) {
        PreferUtils.put("address", address);
    }

    public static String getGetAddr() {
        return PreferUtils.getString("address", "");
    }

    public static void clearGetAddr() {
        PreferUtils.put("address", "");
    }

    public static void putPayType(String paytype) {
        PreferUtils.put("paytype", paytype);
    }

    public static String getPayrType() {
        return PreferUtils.getString("paytype", "-1");
    }

    public static void clearPayType() {
        PreferUtils.put("paytype", "");
    }

    public static void putAvatar(String avatar) {
        PreferUtils.put("avatar", avatar);
    }

    public static String getAvatar() {
        return PreferUtils.getString("avatar", "");
    }

    public static void putGuide(String guide) {
        PreferUtils.put("guide", guide);
    }

    public static String getGuide() {
        return PreferUtils.getString("guide", "");
    }

    public static void putJpushEventType(String jpushEventType) {
        PreferUtils.put("jpushEventType", jpushEventType);
    }

    public static String getJpushEventType() {
        return PreferUtils.getString("jpushEventType", "");
    }

    public static String clearJpushEventType() {
        return PreferUtils.getString("jpushEventType", "");
    }

    /***
     * 0库中用户登录 2.微信 1.qq 3.微博
     *
     * @param source
     */
    public static void putThirdSource(int source) {
        PreferUtils.put("source", source);
    }

    public static int getThirdSource() {
        return PreferUtils.getInt("source", 0);
    }

    public static void putOpenid(String openid) {
        PreferUtils.put("openid", openid);
    }

    public static String getOpenid() {
        return PreferUtils.getString("openid", "");
    }

    public static void clearOpenid() {
        PreferUtils.put("openid", "");
    }

    public static void putAccessToken(String access_token) {
        PreferUtils.put("access_token", access_token);
    }

    public static void putLat(String lat) {
        PreferUtils.put("lat", lat);
    }

    public static void putLon(String lon) {
        PreferUtils.put("lon", lon);
    }

    public static void putStreet(String street) {
        PreferUtils.put("street", street);
    }

    public static String getStreet() {
        return PreferUtils.getString("street", "");
    }

    public static void putAddress(String address) {
        PreferUtils.put("address", address);
    }

    public static String getAddress() {
        return PreferUtils.getString("address", "");
    }

    public static String getLat() {
        return PreferUtils.getString("lat", "0.0");
    }

    public static String getLon() {
        return PreferUtils.getString("lon", "0.0");
    }

    public static void putCity(String city) {
        PreferUtils.put("city", city);
    }

    public static String getSex() {
        return PreferUtils.getString("sex", "");
    }

    public static void putSex(String sex) {
        PreferUtils.put("sex", sex);
    }

    public static String getCity() {
        return PreferUtils.getString("city", "");
    }

    public static String getAccessToken() {
        return PreferUtils.getString("access_token", "");
    }

    public static void clearAccessToken() {
        PreferUtils.put("access_token", "");
    }

    public static void clearAvatar() {
        PreferUtils.put("avatar", "");
    }

    public static void clearUserPhone() {
        PreferUtils.put("userPhone", "");
    }

    public static boolean isLogin() {
        return !TextUtils.equals(PreferUtils.getString("user_id", ""), "");
    }

    /**
     * 关于我们
     *
     * @param aboutus
     */
    public static void putSystemAboutus(String aboutus) {
        PreferUtils.put("aboutus", aboutus);
    }

    public static String getSystemAboutus() {
        return PreferUtils.getString("aboutus", "");
    }

    /**
     * 抽奖活动规则
     *
     * @param role
     */
    public static void putSystemRole(String role) {
        PreferUtils.put("role", role);
    }

    public static String getSystemRole() {
        return PreferUtils.getString("role", "");
    }

    /**
     * 课程介绍
     *
     * @param courseintroduction
     */
    public static void putSystemCourseintroduction(String courseintroduction) {
        PreferUtils.put("courseintroduction", courseintroduction);
    }

    public static String getSystemCourseintroduction() {
        return PreferUtils.getString("courseintroduction", "");
    }

    /**
     * 抽奖大转盘
     *
     * @param game
     */
    public static void putSystemGame(String game) {
        PreferUtils.put("game", game);
    }

    public static String getSystemGame() {
        return PreferUtils.getString("game", "");
    }

    /**
     * 干货详情
     *
     * @return
     */
    public static void putSystemGoodsdetails(String goodsdetails) {
        PreferUtils.put("goodsdetails", goodsdetails);
    }

    public static String getSystemGoodsdetails() {
        return PreferUtils.getString("goodsdetails", "");
    }

    /**
     * 活动详情
     *
     * @param activitydetails
     */
    public static void putSystemActivitydetails(String activitydetails) {
        PreferUtils.put("activitydetails", activitydetails);
    }

    public static String getSystemActivitydetails() {
        return PreferUtils.getString("activitydetails", "");
    }

    /**
     * 姓名
     *
     * @param realName
     */
    public static void putRealName(String realName) {
        PreferUtils.put("realName", realName);
    }

    public static String getRealName() {
        return PreferUtils.getString("realName", "");
    }

    /**
     * 分享地址
     *
     * @param shareUrl
     */
    public static void putSystemShareUrl(String shareUrl) {
        PreferUtils.put("shareUrl", shareUrl);
    }

    public static String getSystemShareUrl() {
        return PreferUtils.getString("shareUrl", "");
    }

    /**
     * 图片地址
     *
     * @param imgstatic
     */
    public static void putSystemImgstatic(String imgstatic) {
        PreferUtils.put("imgstatic", imgstatic);
    }

    public static String getSystemImgstatic() {
        return PreferUtils.getString("imgstatic", "http://pic.jianrenmatou.com/uploadFiles/uploadImgs/");
    }

    /**
     * 课程完成次数
     *
     * @param traincount
     */
    public static void putTraincount(String traincount) {
        PreferUtils.put("traincount", traincount);
    }

    public static String getTraincount() {
        return PreferUtils.getString("traincount", "");
    }

    /**
     * 总视频播放时长
     *
     * @param usePlayTimeTotal
     */
    public static void putUsePlayTimeTotal(long usePlayTimeTotal) {
        PreferUtils.put("usePlayTimeTotal", usePlayTimeTotal);
    }

    public static long getUsePlayTimeTotal() {
        return PreferUtils.getLong("usePlayTimeTotal", 0);
    }

    public static void clearUsePlayTimeTotal() {
        PreferUtils.put("usePlayTimeTotal", 0l);
    }

    /**
     * 总消耗卡路里
     *
     * @param usekalTotal
     */
    public static void putUsekalTotal(float usekalTotal) {
        PreferUtils.put("usekalTotal", usekalTotal);
    }

    public static float getUsekalTotal() {
        return PreferUtils.getFloat("usekalTotal", 0);
    }

    public static void clearUsekalTotal() {
        PreferUtils.put("usekalTotal", 0.0f);
    }

    public static void putWeight(String weight) {
        PreferUtils.put("weight", weight);
    }

    public static String getWeight() {
        return PreferUtils.getString("weight", "60");
    }

    /**
     * 是否设置过密码
     *
     * @param isPass
     */
    public static void putIsPass(String isPass) {
        PreferUtils.put("ispass", isPass);
    }

    public static String getIsPass() {
        return PreferUtils.getString("ispass", "");
    }

    public static void clearIsPass() {
        PreferUtils.put("ispass", "");
    }

    /**
     * 是否实名认证
     *
     * @param isreal
     */
    public static void putIsReal(String isreal) {
        PreferUtils.put("isreal", isreal);
    }

    public static String getIsReal() {
        return PreferUtils.getString("isreal", "");
    }

    public static void clearIsReal() {
        PreferUtils.put("isreal", "");
    }

    /**
     * 是否第一次安装
     *
     * @param firstLogin
     */
    public static void putFirstLogin(boolean firstLogin) {
        PreferUtils.put("firstLogin", firstLogin);
    }

    public static boolean getFirstLogin() {
        return PreferUtils.getBoolean("firstLogin", true);
    }

    public static void clearPreference() {
        clearAvatar();
        clearPhotoAddr();
        clearScore();
        clearUserId();
        clearUserNiceName();
        clearPayType();
//		clearUserPhone();
        clearGetAddr();
        clearUserCart();
        clearPayPwd();
        clearIsWorker();
        getJpushEventType();

        clearIsPass();
        clearIsReal();
    }


}
